That shouldn’t even be that hard to make yourself…
Let’s say you have this structure:
// HTML
<ul id="categories">
<li><a href="#">Category 1</a>
<ul>
<li><a href="#">Category 1.1</a></li>
<li><a href="#">Category 1.2</a></li>
<li><a href="#">Category 1.3</a></li>
</ul>
</li>
<li><a href="#">Category 2</a></li>
<li><a href="#">Category 3</a>
<ul>
<li><a href="#">Category 3.1</a></li>
<li><a href="#">Category 3.2</a></li>
<li><a href="#">Category 3.3</a></li>
</ul>
</li>
</ul>
// CSS
#categories, #categories li, #categories ul {
list-style:none;
margin:0;
padding:0;
}
#categories ul {
padding-left:10px;
}
#categories li {
background:url('arrow_right.gif') no-repeat left center;
padding-left:20px;
}
#categories .open {
background-image:url('arrow_down.gif');
}
// Javascript / jQuery
$(function() {
$('#categories ul').hide();
$('#categories li').click(function() {
var sub = $(this).children('ul');
if(sub.is(':visible')) {
sub.show();
$(this).addClass('open');
} else {
sub.hide();
$(this).removeClass('open');
}
});
});
I just wrote this off the top of my head, so it might have a few bugs, but it should work. It has no fancy animations, but those are easily added.
Greetz,
Wouter